package com.qpx.jxcupms.service.impl;

import com.qpx.jxcupms.entity.TMenu;
import com.qpx.jxcupms.mapper.TMenuMapper;
import com.qpx.jxcupms.service.ITMenuService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Mht
 * @since 2020-02-22
 */
@Service
public class TMenuServiceImpl extends ServiceImpl<TMenuMapper, TMenu> implements ITMenuService {


    @Cacheable(value="getMenuByUserName")
    @Override
    @Transactional(propagation= Propagation.MANDATORY,isolation= Isolation.REPEATABLE_READ,rollbackFor=Exception.class)
    public List<TMenu> getMenuByUserName(String name) {

        return this.baseMapper.getMenuByUserName(name);
    }
}
